﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;

/// <summary>
/// AccessDAO 的摘要说明
/// </summary>
public class AccessDAO:AccessConn
{
    //获取信息
    public DataSet getDs(string sql)
    {
        DataSet ds = new DataSet();
        OleDbConnection conn = this.getConn();
        //try
        //{
            conn.Open();
            OleDbDataAdapter da = new OleDbDataAdapter(sql,conn);
            da.Fill(ds,"message");
            conn.Close();
        //}
        //catch
       // { }
        return ds;
    }
    //增加、删除、修改
    public int getComm(string sql)
    {
        int i = 0;
        OleDbConnection conn = this.getConn();
        //try
        //{
            conn.Open();
            OleDbCommand comm = new OleDbCommand(sql,conn);
            i = comm.ExecuteNonQuery();
            conn.Close();
       // }
       // catch
       // { }
        return i;
    }
}
